package com.cloudfun.campusshare.repo;

import com.cloudfun.campusshare.common.constant.IdentityType;
import com.cloudfun.campusshare.entity.UserAuthEntity;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

/**
 * Created by Huqin on 2020/4/16
 */
public interface UserAuthRepo extends
        PagingAndSortingRepository<UserAuthEntity, String>,
        JpaSpecificationExecutor<UserAuthEntity> {

    UserAuthEntity findByUserIdAndIdentityType(String userId, IdentityType identityType);

    List<UserAuthEntity> findAllByUserId(String userId);

    UserAuthEntity findByIdentityTypeAndIdentifier(IdentityType identityType, String identifier);
}
